home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
TCL1
/
FANGS__
/
GRAPHIC.C
< prev
next >
Wrap
Text File
|
1990-05-28
|
1KB
|
98 lines
/* ⌐ 1990 Patrick Doane. */
#include <Graphic.h>
extern RgnHandle theRgn;
void Graphic::IGraphic(WindowPtr theWindow,Rect *theBounds)
{
Object::IObject();
bounds = *theBounds;
extent = *theBounds;
itsWindow = theWindow;
nextGraphic = 0L;
clickOK = false;
active = true;
activate = true;
visible = true;
hScale = vScale = 1;
position.h = 0;
position.v = 0;
}
void Graphic::Dispose(void)
{
inherited::Dispose();
}
void Graphic::SetBounds(Rect *theBounds)
{
bounds = *theBounds;
}
void Graphic::GetBounds(Rect *theBounds)
{
*theBounds = bounds;
}
void Graphic::Show(void)
{
visible = true;
}
void Graphic::Hide(void)
{
visible = false;
}
void Graphic::Activate(void)
{
if (!active)
active = true;
}
void Graphic::Deactivate(void)
{
if (active)
active = false;
}
void Graphic::Update(void)
{
}
void Graphic::DoClick(EventRecord *theEvent)
{
}
void Graphic::Idle(void)
{
}
void Graphic::Scroll(short hDelta,short vDelta,Boolean redraw)
{
short hPixels;
short vPixels;
Rect theRect;
hPixels = hDelta * hScale;
vPixels = vDelta * vScale;
if (redraw)
{ theRect = bounds;
ScrollRect(&theRect,-hPixels,-vPixels,theRgn);
InvalRgn(theRgn);
}
position.h += hDelta;
position.v += vDelta;
if (redraw)
{ BeginUpdate(thePort);
Update();
EndUpdate(thePort);
}
}